﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RulesEngine
{
    /// <summary>
    /// Basic company class of the game
    /// </summary>
    class Company : GameObjectBase
    {
        /// <summary>
        /// How happy the workers are.
        /// </summary>
        public int Happiness { get; set; }
        /// <summary>
        /// How much salary the salary costs are per turn
        /// </summary>
        public int Salary { get; set; }
        /// <summary>
        /// Amount of workers
        /// </summary>
        public int Workers { get; set; }
        /// <summary>
        /// Income per turn
        /// </summary>
        public int Income { get; set; }
        /// <summary>
        /// Risk of getting caught
        /// </summary>
        public int Risk { get; set; }
        /// <summary>
        /// Type of the company
        /// </summary>
        public CompanyType CompanyType { get; set; }
        /// <summary>
        /// Active operations
        /// </summary>
        public ICollection<Operation> Operations { get; set; } 

        /// <summary>
        /// Have the workers recently enjoyed sauna?
        /// </summary>
        /// <returns>True, if the workers are still in awe</returns>
        public bool HaveSauna()
        {
            return Operations.Any(operation => operation.OperationType == OperationType.CompanySauna && operation.RoundsActive > 1);
        }
    }
}
